package homework.bean;

public class Book {
    private int id;
    private String title;
    private String author;
    private double price;
    private Integer sales;//销量
    private Integer stock;//库存
    private String imgPath = "static/img/default.jpg";

    public Book() {

    }

    public Book(int id, String title, String author, double price, Integer stock, Integer sales, String imgPath) {
        this.id = id;
        this.title = title;
        this.author = author;
        this.price = price;
        this.stock = stock;
        this.sales = sales;
        this.imgPath = imgPath;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Integer getSales() {
        return sales;
    }

    public void setSales(Integer sales) {
        this.sales = sales;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public String getImgPath() {
        return imgPath;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }
    public String show(){
        return "id:"+id+" 书名为:"+title+" 作者为:"+author+" 价格为:"+price+" 库存:"+stock+" 销量:"+sales+" 书封面:"+imgPath;
    }
}
